{extend name="layout"}
{block name="title"}ThinkPHP学习 - 错误和日志{/block}

{block name="content"}
<script>
    var $ = layui.$;
    $('#nav-log').addClass('layui-this')
</script>

<style>
    h1{
        margin-top: 20px;
    }
    p {
        margin-left: 20px;
    }
</style>

<section>
    <h1>日志</h1>
    <ul>
        <li>文件路径：runtime/log</li>
        <li>方法1：Log::record('测试日志信息','warning')</li>
        <li>方法2（助手函数）：trace($text);</li>
    </ul>
</section>

<section>
    <h1>日志级别（低到高）</h1>
    <p>debug, info, notice, warning, error, critical, alert, emergency</p>
</section>

<section>
    <h1>错误</h1>
    <p>try/catch的使用</p>
    <p><a href="https://doc.thinkphp.cn/v8_0/exception_handle.html" target="_blank">更多查看</a></p>
</section>
{/block}